home *** CD-ROM | disk | FTP | other *** search
/ The Epic Collection 3 / Epic Collection 3, The (1997)(Epic Marketing)[!].iso / applications / amigabase / arexx / search.rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-08  |  693b  |  40 lines

  1. /* Program to search for a specific entry and display it. */
  2.  
  3. /* Make sure AB is running. */
  4. if ~show(PORTS, 'AB_AREXX') then do
  5.     say 'AB is not currently running!  Please start it and try again.'
  6.     exit
  7.     end
  8.  
  9. address 'AB_AREXX'
  10.  
  11. options results
  12.  
  13. 'HIDE'
  14.  
  15. /* Ask for and get the name. */
  16. say 'Enter name ?'
  17. parse pull NAME$
  18. FOUND = 0;
  19.  
  20. /* Go to the first entry. */
  21. 'FIRST_ENTRY'
  22.  
  23. /* Start the search going. */
  24. 'SEARCH 1 'NAME$
  25. FINISHED$ = RESULT
  26.  
  27. /* See if we have found it. */
  28. if RC = 0 & FINISHED$ ~= 'Not found' then do
  29.     'SHOW'
  30.     end
  31. if RC = 0 & FINISHED$ = 'Not found' then do
  32.     say NAME$' was not found!'
  33.     end
  34. if RC ~= 0 then do
  35.     say 'Unable to search'
  36.     end
  37.  
  38. exit
  39.  
  40.